// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   ListaSubtiposAction.java

package org.fiel.struts.actions;

import java.util.*;
import org.fiel.commons.jdbc.*;
import org.fiel.domain.Subtipo;
import org.fiel.domain.TipoSubtipoImpl;
import org.fiel.persistence.InformacionPersistor;
import org.fiel.persistence.SubtipoPersistor;

// Referenced classes of package org.fiel.struts.actions:
//            FielAction

public class ListaSubtiposAction extends FielAction
{

    public ListaSubtiposAction()
    {
    }

    protected List ObtenerInformacionSubtipos(List subtipoList, String rol)
    {
        if(subtipoList == null)
            return null;
        List cuadrosList = new ArrayList();
        Finder persistor = new InformacionPersistor();
        List constraintList = new ArrayList(3);
        for(Iterator it = subtipoList.iterator(); it.hasNext(); constraintList.clear())
        {
            Subtipo subtipo = (Subtipo)it.next();
            constraintList.add(new Constraint("identipo", "=", subtipo.getIdentipo()));
            constraintList.add(new Constraint("idensubtipo", "=", subtipo.getIdensubtipo()));
            if(rol != null)
                constraintList.add(new FunctionInstrConstraint("nivel", rol));
            List informacionList = persistor.FindAll(constraintList);
            cuadrosList.add(new TipoSubtipoImpl(subtipo, informacionList));
        }

        return cuadrosList;
    }

    protected List ObtenerSubtipos(Integer tipo)
    {
        List ls = new ArrayList();
        ls.add(new Constraint("identipo", "=", tipo));
        Finder persistor = new SubtipoPersistor();
        return persistor.FindAll(ls);
    }
}
